<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page  %>
<%@ page import="okhttp3.*" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.interfaces.workflow.action.Action" %>
<%@ page import="weaver.soa.workflow.request.RequestInfo" %>
<%@ page import="lombok.SneakyThrows" %>
<%@ page import="java.util.Random" %>
<%
    package com.hbjsl;

    public class JslTestAction extends BaseBean implements Action {

        @SneakyThrows
        @Override
        public String execute(RequestInfo requestInfo) {

            OkHttpClient client = new OkHttpClient().newBuilder()
                    .build();
            MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
            RequestBody body = RequestBody.create(mediaType, "requestId=185188&auditResult="+new Random().nextInt(10)+"&msg=审核通过");
            Request testRequest = new Request.Builder()
                    .url("172.16.68.112:8011/api/portal/ams/appointment/audit")
                    .method("POST", body)
                    .addHeader("Content-Type", "application/x-www-form-urlencoded")
                    .build();
            Response testResponse = client.newCall(testRequest).execute();
            return testResponse.toString();
        }
    }
%>

<%

    out.print("开始测试 ... ");


%>

